// gamecameramanipulator.h

// 2008-05-02 11:20:13 (Jake): created

#ifndef gamecameramanipulator_h
#define gamecameramanipulator_h 1

class Game;

class GameCameraManipulator : public osgGA::MatrixManipulator {
public:
	GameCameraManipulator(Game* game);

    virtual const char* className() const { return "GameCameraManpulator"; }
    virtual void setByMatrix(const osg::Matrixd& matrix);
    virtual void setByInverseMatrix(const osg::Matrixd& matrix) { setByMatrix(osg::Matrixd::inverse(matrix)); }
    virtual osg::Matrixd getMatrix() const;
    virtual osg::Matrixd getInverseMatrix() const;
	virtual void setNode(osg::Node* node) { _node = node; }
	virtual const osg::Node* getNode() const { return _node.get(); }
    virtual osg::Node* getNode() { return _node.get(); }
    virtual void computeHomePosition();
	virtual void home(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us);
    virtual void init(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us);
    virtual bool handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us);
    virtual void getUsage(osg::ApplicationUsage& usage) const;

protected:
	osg::ref_ptr<Game> _game;
	osg::ref_ptr<osg::Node> _node;
	osg::Matrixd _matrix;
	osg::Vec3 _eye;
	osg::Quat _rotation;
};

#endif